<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>

<nav class="navbar navbar-default pet-navbar">
  <div class="container-fluid">
    <!-- Brand and toggle get grouped for better mobile display -->
    <div class="navbar-header">
      <a class="navbar-brand" href="${ctx}/shop/index"><img src="${ctx.resource}/images/logo-topbar.gif"></a>
    </div>

    <!-- Collect the nav links, forms, and other content for toggling -->
    <div class="collapse navbar-collapse">
      <form class="navbar-form navbar-right" method="post" action="${ctx}/shop/searchProducts.do" role="search">
        <div class="form-group">
          <input type="text" class="form-control" placeholder="Search">
        </div>
        <button type="submit" class="navbar-submit"><img src="${ctx.resource}/images/search.gif"></button>
      </form>
      
      <ul class="nav navbar-nav navbar-right pet-nav">
        <li><a href="${ctx}/shop/viewCart.do"><img src="${ctx.resource}/images/cart.gif"></a></li>
        <c:choose>
          <c:when test="${empty userSession.account}">
            <li><a href="${ctx}/shop/signin"><img src="${ctx.resource}/images/sign-in.gif"></a></li>
          </c:when>
          <c:otherwise>
            <li><a href="${ctx}/shop/signoff.do"><img src="${ctx.resource}/images/sign-off.gif"></a></li>
            <li><a href="${ctx}/shop/editAccount.do">"><img src="${ctx.resource}/images/my_account.gif"></a></li>
          </c:otherwise>
        </c:choose>
        <li><a href="${ctx}/shop/viewCart.do"><img src="${ctx.resource}/images/help.gif"></a></li>
      </ul>
    </div>
  </div>
</nav>
